<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="expires" content="Thu,01 Jan 1970 00:00:01 GMT">
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-cache">
    <!--<meta http-equiv="Content-Security-Policy" content="default-src 'self';font-src 'self' data: https://fonts.gstatic.com https://fonts.googleapis.com/;style-src 'self' 'unsafe-inline'; media-src *;script-src 'self' http://api.map.baidu.com ;">-->
    <meta http-equiv="content-Type" content="text/html; charset=utf-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <link href="__IMG__/logo.png" rel="shortcut icon" type="image/x-icon">
    <title>花椒-辣椒-香料-调味品-附城--成都味之初农产品有限公司</title>
    <base target="_self">
    <meta name="keywords" content="成都调味品批发交易贸易，花椒，辣椒，香料，成都调味品">
    <meta name="description" content="成都味之初农产品有限公司,专注于花椒，辣椒，香料等调味品批发贸易">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <link rel="stylesheet" href="__LIB__/layui/css/layui.css">
    <link rel="stylesheet" href="__CSS__/bootstrap.min.css">
    <link rel="stylesheet" href="__CSS__/reset.css">
    <link rel="stylesheet" href="__CSS__/common.css">
    <link rel="stylesheet" href="__CSS__/user_info_edit.css">
    <script>
        var _hmt = _hmt || [];
        (function() {
            var hm = document.createElement("script");
            hm.src = "https://hm.baidu.com/hm.js?68cca1e88d91513304d45edd3b72a6ba";
            var s = document.getElementsByTagName("script")[0];
            s.parentNode.insertBefore(hm, s);
        })();
    </script>
</head>
<body>
    <top class="prod-huajiao">
        <header class="navbar navbar-default">
            <div class="container">
                <!--小屏幕导航按钮和logo-->
                <div class="navbar-header">
                    <button class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    <div id="logo-part-for-mobile" style="display: none;">
                        <a href="http://cdweizhichu.com/">
                            <img src="__IMG__/logo.png" class="logo">
                            <span>附城</span>
                        </a>
                    </div>
                </div>
                <!--小屏幕导航按钮和logo-->
                <!--导航-->

                <div class="navbar-collapse collapse">
                    <div id="logo-part-for-pc">
                        <h1 style="display: inline-block;">
                            <a href="http://cdweizhichu.com/" style="display: block">
                                <img src="__IMG__/logo.png" class="logo">
                                <span class="logo-right-txt">附城</span>
                            </a>
                        </h1>
                    </div>
                    <ul id="main-navigation" class="nav navbar-nav">
                        <li>

                            <a href="/">附城</a>

                        </li>
                        <li >
                            <a href="/index/index/huajiao">花椒</a>
                        </li>
                        <li class="">

                            <a href="/index/index/lajiao">辣椒</a>

                        </li>
                        <li class="">

                            <a href="/index/index/xiangliao">香料</a>

                        </li>
                        <li class="prod-center active">

                            <a href="#">产品中心<i class="nav-arrow-up"></i></a>

                            <ul>
                                <li><a href="/index/index/prodhuajiao" style="background: #CE7D3A;color: #fff;">花椒产品</a></li>
                                <li><a href="/index/index/prodlajiao">辣椒产品</a></li>
                                <li><a href="/index/index/prodxiangliao">香料产品</a></li>
                                <li><a href="/index/index/prodquality">精品展示</a></li>
                            </ul>
                        </li>
                        <li class="">

                            <a href="./news.html">最新资讯</a>

                        </li>
                        <li class="">

                            <a href="./story.html">故事欣赏</a>

                        </li>
                    </ul>
                </div>
                <!--导航-->
            </div>
        </header>
    </top>

    <div class="user-info">
        <div class="title"><span></span>会员编辑</div>
        <div class="user-edit-area">
            <!--<div class="item user-avatar">-->
                <!--<span class="info-label">当前头像:</span>-->
                <!--<span class="avatar-box">-->
                    <!--<img src="__IMG__/avatar.png" alt="">-->
                    <!--<span class="edit-avatar">编辑头像</span>-->
                    <!--<input type="file" class="upload_avatar" style="display: none">-->
                <!--</span>-->
            <!--</div>-->
            <!--<div class="item">
                <span class="info-label require-need"><i>*</i>昵称:</span>
                <input type="text" class="nick-name">
            </div>-->
            <div class="item">
                <span class="info-label">真实姓名:</span>
                <input type="text" class="real-name">
            </div>
            <div class="item">
                <span class="info-label require-need"><i>*</i>性别:</span>
                <input type="radio" name="sex" checked value="0">男
                <input type="radio" name="sex" value="1">女
            </div>
            <div class="item birth-date">
                <span class="info-label">出生日期:</span>
                <select name="" id="date-sel-year">
                    <!--<option value="">年</option>-->
                </select>年
                <select name="" id="date-sel-month">
                    <!--<option value="">月</option>-->
                </select>月
                <select name="" id="date-sel-day">
                    <!--<option value="">日</option>-->
                </select>日
            </div>
            <div class="item">
                <span class="info-label">居住地:</span>
                <input type="text" class="residence">
            </div>
            <div class="item edit_confirm">
                <span class="info-label"></span>
                <button class="btn btn-primary" id="post_edit">确定</button>
            </div>
        </div>
    </div>

    {include file="/common" /}

    <!--user part-->
    {include file="index@base/userinfo"}



    <div id="outerdiv" style="position:fixed;top:0;left:0;background:rgba(0,0,0,0.7);z-index:2;width:100%;height:100%;display:none;">
        <div id="innerdiv" style="position:absolute;">
            <img id="bigimg" style="border:5px solid #fff;" src="" />
        </div>
    </div>
</body>
<script src="__JS__/jQuery-1.11.1.min.js"></script>
<script src="__LIB__/layui/layui.js"></script>
<script src="__JS__/bootstrap.min.js"></script>
<script src="__JS__/birth-date.js"></script>
<script>
    $.date_picker({
            YearSelector:  "#date-sel-year",
        MonthSelector: "#date-sel-month",
        DaySelector:   "#date-sel-day"
    });
    // $.ms_DatePicker();
</script>
<script>
    (function(){
        var bp = document.createElement('script');
        var curProtocol = window.location.protocol.split(':')[0];
        if (curProtocol === 'https') {
            bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
        }
        else {
            bp.src = 'http://push.zhanzhang.baidu.com/push.js';
        }
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(bp, s);
    })();
</script>
<script>
    $(function () {
        $('.user-fixed-right').mouseenter(function () {
            $(this).css({right:0,height:'200px',background:'#3A394D',borderColor: '#333',borderRadius:0,transition:'all .3s ease-out'})
            $('.user-edit').show()
        }).mouseleave(function () {
            $(this).css({right:'-50px',height:'100px',background:'#fff',borderColor: '#efa123',borderRadius:'50%',transition:'all .3s ease-out'})
            $('.user-edit').hide()
        })
    })
</script>
<script>
    layui.use('layer', function(){ //独立版的layer无需执行这一句
        var layer = layui.layer; //独立版的layer无需执行这一句
    });
</script>
<script>
    $(function () {
        setTimeout(function () {

        },800)


        //编辑头像
        /*$('.edit-avatar').on('click',function () {
            $('.upload_avatar').click()
            var avatarName = $('.upload_avatar')[0].value.split('\\')
            var splitIndex = avatarName.length - 1
            $.post('',{avatar: avatarName[splitIndex]},function (res) {
                if(res.code === 200) {
                    $(this).siblings('img')[0].src = res.avatarUrl
                }
            })
        })*/


        //获取用户个人资料
        var _star = ''
        var realName
        var residence
        var realName_cp
        var residence_cp
        $.get('/index/member/getOneMember',function (res) {
            if(res.code == 1) {
                $('.real-name').val(res.msg.memb_name)
                $(':radio[name=sex]').eq(res.msg.memb_sex).click()
                var birthday = res.msg.memb_birthday.split('-')
                $('#date-sel-year').val(birthday[0])
                $('#date-sel-month').val(birthday[1])
                $('#date-sel-month').change()
                $('#date-sel-day').val(birthday[2])
                $('.residence').val(res.msg.memb_dwell)

                realName_cp = realName = $('.real-name').val()
                residence_cp = residence = $('.residence').val()

                //多余信息用*代替
                for(var i=0;i<$('input[type=text]').length;i++) {
                    var inputVal = $(':text').eq(i).val()
                    if(inputVal.length > 2) {
                        var inputValLen = inputVal.length - 2
                        while(inputValLen > 0) {
                            _star += '*'
                            inputValLen--
                        }
                        $(':text').eq(i).val(inputVal.substr(0,1)+_star+inputVal.substr(-1))
                    }else if(inputVal.length === 2) {
                        $(':text').eq(i).val(inputVal.substr(0,1)+'*')
                    }
                }
            }
        },'json')

        //多余信息用*代替
        function hasStar(i) {
            var inputVal = $(':text').eq(i).val()
            _star = ''
            if(inputVal.length > 2) {
                var inputValLen = inputVal.length - 2
                while(inputValLen > 0) {
                    _star += '*'
                    inputValLen--
                }
                $(':text').eq(i).val(inputVal.substr(0,1)+_star+inputVal.substr(-1))
            }else if(inputVal.length === 2) {
                $(':text').eq(i).val(inputVal.substr(0,1)+'*')
            }
        }

        $(':text').on('focus',function () {
            if($(this).val().indexOf('*') != -1 && $(this).hasClass('real-name')) {
                $(this).val(realName)
            }
            if($(this).val().indexOf('*') != -1 && $(this).hasClass('residence')) {
                $(this).val(residence)
            }
        }).on('blur',function () {
            if($(this).val() == realName && realName && $(this).hasClass('real-name')) {
                hasStar(0)
            }
            if($(this).val() == residence && residence && $(this).hasClass('residence')) {
                hasStar(1)
            }
        }).on('input',function () {
            if($(this).hasClass('real-name') && $(this).val() != realName) realName = ''
            if($(this).hasClass('residence') && $(this).val() != residence) residence = ''
        })

        //确定修改保存
        $('#post_edit').on('click',function () {
            $.post('/index/member/memberEdit',{
                memb_name: $('.real-name').val().indexOf('*') != -1 ? realName_cp : $('.real-name').val(),
                memb_sex: $(':radio[name=sex]:checked').val(),
                memb_birthday: $('#date-sel-year').val()+'-'+$('#date-sel-month').val()+'-'+$('#date-sel-day').val(),
                memb_dwell : $('.residence').val().indexOf('*') != -1 ? residence_cp : $('.residence').val()
            },function (res) {
                if(res.code == 1) {
                    layer.msg('修改成功！',{icon: 1,time: 600000})
                    // window.location.reload()
                }
            })
        })


        if(window.screen.width < 500) {
            var prodUl = true
            $('.prod-center>a').on('click',function () {
                if(prodUl) {
                    $(this).siblings().show()
                    $(this).find('.nav-arrow-up').css({transform:'translateY(-20%) rotate(315deg)',transition:'all .35s ease-in-out'})
                    prodUl = false
                }else {
                    $(this).siblings().hide()
                    $(this).find('.nav-arrow-up').css({transform:'translateY(-50%) rotate(135deg)'})
                    prodUl = true
                }
            })
            setTimeout(function () {
                $('.navbar-collapse').children('#logo-part-for-pc').remove()
                $('.collapse').css({height:0,overflow:'hidden',border:'none'}).show()
                $('#logo-part-for-mobile').show()
            }, 800)
        }else{
            setTimeout(function () {

            },800)
        }


        //手机屏下的导航显示
        var toggleState = true
        $('.navbar-toggle').on('click',function () {
            if(toggleState){
                $('.navbar-collapse').css({transform:'scaleY(1)',transformOrigin:'top',transition: 'all .35s ease'})
                if($('.prod-center ul').css('display') === 'block') {
                    setTimeout(function () {
                        $('.navbar-collapse').css({height:'350px'})
                    }, 380)
                }
                toggleState = false
            }else{
                $('.navbar-collapse').css({transform:'scaleY(0)',transformOrigin:'top',transition: 'all .35s ease'})
                if($('.prod-center ul').css('display') === 'block') $('.prod-center ul').css('display') === 'none'
                toggleState = true
            }
        })
        $('.prod-center').on('click',function () {
            if($('.prod-center ul').css('display') === 'block') $('.navbar-collapse').css({height:'350px'})
            else $('.navbar-collapse').css({height:'302px'})
        })

    })
</script>
</html>